package com.hlg.xboot.config;

import com.digi_zones.common.config.*;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * <p>应用参数配置</p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company: 中视数讯</p>
 * <p>Site: www.digi-zones.com</p>
 *
 * @author yangxin
 * @version 1.0
 * @date 2016/8/4
 */
@Component
@ConfigurationProperties(prefix = "app", locations = "classpath:app.yml")
public class AppConfig {

    /**
     * 网络协议
     */
    private String protocol;

    /**
     * 后台服务地址
     */
    private String host;

    /**
     * 前端访问地址
     */
    private String app;

    /**
     * 即时通信服务配置
     */
    private TencentImConfig im;

    /**
     * 阿里云服务配置
     */
    private AliyunConfig aliyun;

    /**
     * 微信SDK参数配置
     */
    private WeChatConfig weixin;

    /**
     * 支付宝参数配置
     */
    private AlipayConfig alipay;

    /**
     * QQ开放平台配置
     */
    private QQConfig qq;

    public QQConfig getQq() {
        return qq;
    }

    public void setQq(QQConfig qq) {
        this.qq = qq;
    }

    public AlipayConfig getAlipay() {
        return alipay;
    }

    public void setAlipay(AlipayConfig alipay) {
        this.alipay = alipay;
    }

    public WeChatConfig getWeixin() {
        return weixin;
    }

    public AliyunConfig getAliyun() {
        return aliyun;
    }

    public TencentImConfig getIm() {
        return im;
    }

    public void setIm(TencentImConfig im) {
        this.im = im;
    }

    public String getServer() {
        return this.protocol + "://" + this.getHost();
    }

    public String getProtocol() {
        return protocol;
    }

    public String getHost() {
        return host;
    }

    public String getApp() {
        return this.getProtocol() + "://" + app;
    }

    public void setAliyun(AliyunConfig aliyun) {
        this.aliyun = aliyun;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public void setWeixin(WeChatConfig weixin) {
        this.weixin = weixin;
    }

}
